<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function fun1(){
				var node=document.createElement("div")
				node.innerHTML="文字节点"
				document.getElementById("con").appendChild(node)
			}
			function fun2(){
				var node=document.createElement("img")
				node.setAttribute("src","img/ok.png")
				document.getElementById("con").appendChild(node)
			}
			function fun3(){
				
				var con = document.getElementById("con")
				con.removeChild(con.firstChild)
				
				
			}
			function fun4(){
				var btn = document.querySelector("button")
				btn.parentNode.removeChild(btn)
			}
		</script>
	</head>
	<body>
		<button type="button" onclick="fun1()">添加文本</button>
		<button type="button" onclick="fun2()">添加图片</button>
		<button type="button" onclick="fun3()">删除</button>
		<button type="button" onclick="fun4()">删除按钮</button>
		<div id="con"></div>
		
	</body>
</html>
